package org.wzl.personalwebsite.controller;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wzl.personalwebsite.dto.SetLogDTO;
import org.wzl.personalwebsite.service.LogService;
import org.wzl.personalwebsite.utils.Resp;

/**
 * @author 卫志龙
 * @version 1.0
 * @date 2024/9/21 17:55
 */
@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

    @Resource
    private LogService logService;

    @PostMapping("/setLog")
    public Resp<?> setLoad(@RequestBody SetLogDTO setLogDTO, HttpServletRequest request) {
        logService.setLog(setLogDTO, request);
        return Resp.ok();
    }

}
